//
//  SelectedEntryView.m
//  FKGW
//
//  Created by song ce on 2017/3/2.
//  Copyright © 2017年 song ce. All rights reserved.
//

#import "SelectedEntryView.h"
#import "OSSHelper.h"
@implementation SelectedEntryView

- (void)awakeFromNib {
    [super awakeFromNib];
    self.layer.cornerRadius = 5;
    self.layer.masksToBounds =YES;
    self.employee1.layer.cornerRadius = 10.5;
    self.employee1.layer.masksToBounds = YES;
    self.employee2.layer.cornerRadius = 10.5;
    self.employee2.layer.masksToBounds = YES;
    self.employee3.layer.cornerRadius = 10.5;
    self.employee3.layer.masksToBounds = YES;
    self.shopIconImageV.layer.cornerRadius = 16;
    self.shopIconImageV.layer.masksToBounds = YES;

}

-(void)setModel:(SelectedEntryModel *)model{
    _model = model;
    self.shopNameLabel.text = _model.storeName;
    self.dizhiTextView.text = _model.detailedAddress;
    if([_model.purpose isKindOfClass:[NSNull class]]){
        self.zongzhiTextView.text = @"此店铺暂无简介";
    }else{
        self.zongzhiTextView.text = _model.purpose;
    }
    self.pnumLabel.text = _model.phone;
    [[OSSHelper sharedHelper]OSSDownLoadWithObjectKey:_model.storePhoto xOssProcess:[NSString stringWithFormat:@"image/resize,m_fill,w_%d,h_%d",32,32]  downLoadBlock:^(NSData *data) {
        dispatch_async(dispatch_get_main_queue(), ^{
            self.shopIconImageV.image= [UIImage imageWithData:data];
        });
    }];
    //显示直播店员
//live:{[
//       name:  // 直播店员名字
//       id： // 直播电源标识
//       playAddress:// 直播地址
//       ]，
    NSArray *liveArray = _model.liveArray;
    if(!liveArray.count){
        self.alertView.hidden = NO;
        self.employee1.hidden = YES;
        self.employee2.hidden = YES;
        self.employee3.hidden = YES;
    }
}
- (IBAction)close:(UIButton *)sender {
    if(self.closeBlock){
        self.closeBlock();
    }
}

- (IBAction)phone1:(UIButton *)sender {
}



- (IBAction)employee1:(UIButton *)sender {
}
- (IBAction)employee2:(UIButton *)sender {
}

- (IBAction)employee3:(UIButton *)sender {
}

@end
